// let x: never
// x = 100
// x = 'asdf'

function demo1():number {
  return 100
}
function demo2():undefined {
}

function demo3():never {
  throw new Error('error') // 抛出异常并立刻结束函数调用
}

function demo4():never {
  while(true) {
    console.log('demo4')
  }
}

// ts主动推断a为never
let a: string = 'asdf'
if (typeof a === 'string') {
  console.log(a.length)
} else {
  console.log(a)
}

export {}